package cn.rongdao.jrkabao.model.cashadvance;

import com.mifengkong.frtools.http.request.HttpFunction;

import java.util.List;

import cn.rongdao.jrkabao.bean.cashadvance.SelectBankCardBean;
import cn.rongdao.jrkabao.model.api.BaseKaMaoModel;
import io.reactivex.Observable;
import io.reactivex.Observer;

/**
 * Created by jack on 2017/8/8
 */

public class SelectBankCardModel extends BaseKaMaoModel {

    public static SelectBankCardModel getInstance() {
        return getPresent(SelectBankCardModel.class);
    }

    public void execute(boolean type, Observer<List<SelectBankCardBean>> observer) {
        addParamStrings("type", type ? "2" : "1");
        Observable<List<SelectBankCardBean>> observable = mServletApi.getBankList(mParams).map(new HttpFunction<List<SelectBankCardBean>>());
        toSubscribe(observable, observer);
    }

}
